import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import pinia from './store'
import * as utils from './utils'
import * as api from './api'

// 自定义编译器选项已不再需要，会导致错误

export function createApp() {
  const app = createSSRApp(App)
  
  // 挂载pinia状态管理
  app.use(pinia)
  
  // 挂载全局API
  app.config.globalProperties.$api = api
  
  // 挂载全局工具函数
  app.config.globalProperties.$utils = utils
  
  return {
    app
  }
}
// #endif